#ifdef ARCTIC

#include "ctc_error.h"
#include "sys_usw_mchip.h"
#include "sys_usw_ipuc.h"
#include "sys_usw_dmps_db.h"
#include "../tsingma/sys_tsingma_ipuc_tcam.h"
#include "../tsingma/sys_tsingma_nalpm.h"
#include "../arctic/sys_nalpm2.h"
#include "../tsingma/sys_tsingma_mac.h"
#include "../tsingma/sys_tsingma_datapath.h"
#include "sys_usw_ftm.h"
#include "../tsingma/sys_tsingma_mcu.h"
#include "../tsingma/sys_tsingma_peri.h"
#include "../tsingma_mx/sys_tmm_linkagg.h"
#include "../tsingma_mx/sys_tmm_acl.h"
#include "../tsingma_mx/sys_tmm_l3if.h"
#include "../tsingma_mx/sys_tmm_ipfix.h"
#include "../tsingma_mx/sys_tmm_dot1ae.h"
#include "../arctic/sys_at_dot1ae.h"
#include "../tsingma_mx/sys_tmm_learning_aging.h"
#include "../tsingma_mx/sys_tmm_security.h"
#include "../tsingma_mx/sys_tmm_qos.h"
#include "../tsingma_mx/sys_tmm_nexthop.h"
#include "../tsingma_mx/sys_tmm_npm.h"
#include "../tsingma_mx/sys_tmm_mirror.h"
#include "../tsingma_mx/sys_tmm_port.h"
#include "../tsingma_mx/sys_tmm_datapath.h"
#include "sys_at_peri.h"

extern int32 sys_at_datapath_init(uint8 lchip, ctc_datapath_global_cfg_t* p_dp_cfg);
extern int32 sys_at_datapath_get_extport_start_id(uint8 lchip, uint16* p_lport_start);
extern int32 sys_at_capability_init(uint8 lchip);
extern int32 sys_at_wb_app_id_init(uint8 lchip, void* p_app_id_info);
extern int32 sys_tsingma_hash_set_config(uint8 lchip, void* p_hash_cfg);
extern int32 sys_tsingma_hash_get_config(uint8 lchip, void* p_hash_cfg);
extern int32 sys_tsingma_hash_set_offset(uint8 lchip, void* p_hash_offset);
extern int32 sys_tsingma_hash_get_offset(uint8 lchip, void* p_hash_offset);
extern int32 sys_tsingma_hash_set_hash_control(uint8 lchip, void* p_hash_ctl);
extern int32 sys_tsingma_hash_get_hash_control(uint8 lchip, void* p_hash_ctl);
extern int32 sys_at_hash_init(uint8 lchip);
extern int32 sys_at_hash_set_selector_ext(uint8 lchip, void* p_hash_selector_ext);
extern int32 sys_at_hash_get_selector_ext(uint8 lchip, void* p_hash_selector_ext);
extern int32 sys_at_hash_set_selector_remap(uint8 lchip, void* p_hash_selector_remap);
extern int32 sys_at_hash_get_selector_remap(uint8 lchip, void* p_hash_selector_remap);
extern int32 _sys_at_hash_set_mask_profile_en(uint8 lchip, uint8 sel_grp_id, uint8 enable);
extern int32 sys_at_hash_set_udf_hash_en(uint8 lchip, void* hash_poly);
extern int32 sys_at_hash_get_udf_hash_en(uint8 lchip, void* hash_poly);
extern int32 sys_at_hash_set_field(uint8 lchip, void* p_hash_fields);
extern int32 sys_at_hash_get_field(uint8 lchip, void* p_hash_fields);
extern int32 sys_at_scl_set_xkey_valid(uint8 lchip, void* user_data, uint8 is_add);
extern int32 sys_at_l3if_register_entry_hash_db(uint8 lchip, void* user_data);
extern int32 sys_tmm_l3if_get_igs_if_rmac(uint8 lchip, uint16 l3if_id, ctc_l3if_router_mac_t* router_mac);
extern void* sys_at_com_entry_hash_init(uint8 lchip, uint32 entry_num, uint32 block_size);
extern int32 sys_at_com_entry_hash_deinit(uint8 lchip, void* user_data);
extern void* sys_at_com_lookup_pp_bmp_hash(void* user_data, uint32 entry_id);
extern int32 sys_at_com_add_pp_bmp_hash(uint8 lchip, uint32 mem_mode, void* user_data, uint32 entry_id, uint16 pp_bmp);
extern int32 sys_at_com_remove_pp_bmp_hash(uint8 lchip, void* user_data, void* node);
extern int32 sys_at_com_remove_pp_bmp_hash_by_entry_id(uint8 lchip, void* user_data, uint32 entry_id);
extern int32 sys_at_get_drop_resson_info(uint16 discard_type, uint8* p_dir, uint8* p_clear_on_read);
extern int32 sys_at_scl_show_flex_key(uint8 lchip, void* data, uint32* key_id, uint32* ad_id);
extern int32 sys_at_interrupt_set_sup_op(uint8 lchip, uint8 grp_id, uint8 act_idx);
extern int32 sys_at_entry_pp_hash_init(uint8 lchip);
extern int32 sys_at_entry_pp_hash_deinit(uint8 lchip);
extern int32 sys_at_mcu_get_mac_stats(uint8 lchip, uint32 block_id, sys_usw_dmps_mac_stats_t* p_mac_stats);
extern int32 sys_at_mcu_clear_mac_stats(uint8 lchip, uint32 block_id, uint8 dir);
extern int32 sys_at_l2_decode_dsmac(uint8 lchip, void* psys, uint32 ad_index, void* p_ds_mac);
extern int32 sys_tmm_l2_encode_key(uint8 lchip, void* p_ds_key, uint32* hw_mac, uint32 fid, uint32 ad_index);
extern int32 sys_at_l2_encode_dsmac(uint8 lchip, void* p_dsmac, void* psys);

extern int32 sys_at_l2_map_dma_to_entry(uint8 lchip, void* pa,uint8* p_data,int32 real_size);
extern int32 sys_at_mcu_get_version(uint8 lchip, sys_usw_dmps_mcu_fw_version_t* p_mcu_version);
extern int32 sys_usw_mcu_hw_lock(uint8 lchip, uint8 core_id, uint32 core_mcu_id, uint8 grand_id, uint8 bit);
extern int32 sys_usw_mcu_hw_unlock(uint8 lchip, uint8 core_id, uint32 core_mcu_id, uint8 grand_id, uint32 bit);
extern int32 sys_usw_dmps_db_cpumac_get_lport_info_by_inner_idx(uint8 lchip, uint8 inner_idx, uint16* lport, uint8 *is_network);
extern int32
sys_tsingma_parser_set_global_cfg(uint8 lchip, ctc_parser_global_cfg_t* p_global_cfg);
extern int32
sys_tsingma_parser_get_global_cfg(uint8 lchip, ctc_parser_global_cfg_t* p_global_cfg);

extern int32
sys_tsingma_parser_set_hash_field(uint8 lchip, void* p_hash_ctl, uint8 hash_usage);
extern int32
sys_tsingma_parser_get_hash_field(uint8 lchip, void* p_hash_ctl, uint8 hash_usage);
extern int32
sys_tsingma_nalpm_show_sram_usage(uint8 lchip);

extern int32
sys_tsingma_parser_hash_init(uint8 lchip);
extern int32
sys_tsingma_mac_link_up_event(uint8 lchip, uint16 lport);
extern int32
sys_tsingma_mac_set_capability(uint8 lchip, uint16 lport, ctc_port_capability_type_t type, uint32 value);

extern int32
sys_at_diag_get_pkt_trace(uint8 lchip, void* p_value, uint8 position);
extern int32
sys_at_diag_get_drop_info(uint8 lchip, void* p_value);
extern int32
sys_at_diag_set_dbg_pkt(uint8 lchip, void* p_value);
extern int32
sys_at_diag_set_dbg_session(uint8 lchip, void* p_value);
extern int32
sys_at_diag_pkt_trace_clear_rslt(uint8 lchip, uint32 watch_point);
extern int32
_sys_at_diag_bist_sram(uint8 lchip, uint8* err_mem_id);
extern int32
sys_tsingma_diag_get_lb_hash(uint8 lchip, ctc_field_key_t* p_field_list, uint32 field_cnt, ctc_diag_lb_hash_t* p_rslt);
extern char*
sys_at_get_discard_type_desc(uint16 discard_type);
extern int32
sys_at_diag_get_pos(uint16 discard, uint8* pos);
extern int32
sys_at_map_drop_reason_ctc_to_sys(uint16 drop_reason, uint32* discard_type_bmp);
extern int32
sys_at_diag_get_drop_reason(uint8 lchip, uint32* reason);

extern int32
sys_tmm_scl_build_hash_key_svlan_dscp_port(uint8 lchip, ctc_field_key_t* pKey, void* pe, uint8 is_add);
extern int32
sys_at_scl_build_hash_key_nsh(uint8 lchip, ctc_field_key_t* pKey, void* pe, uint8 is_add);
extern int32
sys_at_scl_get_flex_key_sets(uint8 lchip, void * scl_flex_key);
extern int32
sys_tmm_scl_build_field_action_userid_vlan_edit(uint8 lchip, void* ds, void* pe, ctc_scl_field_action_t* pAction, uint8 is_add);
extern int32
sys_tmm_scl_build_field_action_userid(uint8 lchip, ctc_scl_field_action_t* pAction, void* pe, uint8 is_add);
extern int32
sys_tmm_scl_get_field_action_userid(uint8 lchip, ctc_scl_field_action_t* p_action, void* pe);
extern int32
sys_tmm_scl_update_action(uint8 lchip, void* data, void* change_nh_param);
extern int32
sys_tmm_scl_get_userid_default_action(uint8 lchip, void* p_default_action);

extern int32
sys_tmm_scl_move_dsuserid_to_temp(uint8 lchip, void* ds, uint8 userid_bmp);
extern int32
sys_at_scl_set_flex_key(uint8 lchip, void * scl_flex_key, uint8 inner);
extern int32
sys_at_scl_build_flex_key_field(uint8 lchip, void * pKey_info, void * pe_info, uint8 is_add);
extern int32
sys_at_scl_get_flex_key(uint8 lchip, void * scl_flex_key, uint8 inner);

extern void
sys_tmm_acl_show_kset(uint8 lchip, ctc_acl_flex_key_t * acl_flex_key);
extern int32
sys_at_acl_add_hash_nsh_sel_field(uint8 lchip, uint8 field_sel_id, ctc_field_key_t* sel_field, uint8 is_add);
extern int32
sys_at_acl_add_flex_hash_field(uint8 lchip, ctc_field_key_t* pKey, void* pe, uint8 is_add);
extern int32
sys_at_acl_show_flex_hash_field(uint8 lchip, void* pe);

extern int32
_sys_at_flow_stats_type_init(uint8 lchip);
extern int32
_sys_tmm_flow_stats_ram_init(uint8 lchip);
extern int32
sys_at_flow_stats_show_status(uint8 lchip);
extern int32
sys_at_flow_stats_ds2count(uint8 lchip, uint32 tbl_id, void * p_ds, ctc_stats_basic_t * p_count);
extern int32
sys_at_flow_stats_sync_fifo_stats(uint8 lchip);

extern int32
_sys_at_mac_stats_get_mac_stats(uint8 lchip, uint32 tbl_id, uint16 tbl_base, uint8 dir, void* p_mac_stats);
extern int32
_sys_at_mac_stats_clear_mac_stats(uint8 lchip, uint32 tbl_id, uint16 tbl_base, uint8 dir);
extern int32
_sys_at_mac_stats_sync_throughput(uint8 lchip, uint32 lport, uint32 tbl_id, uint16 tbl_base, uint32 mac_ipg);
extern int32
sys_at_flow_stats_set_ram_pp_property(uint8 lchip, uint8 dir, uint8 block_id, uint32 lkup_level_bitmap, uint8 is_global);

extern int32
sys_at_map_drop_reason_sys_to_ctc(uint16 discard_type, uint16 * p_drop_reason);
extern int32
sys_at_map_discard_type(uint8 lchip, uint8 dir, uint8 drop_reason_en);

extern int32
sys_at_interrupt_get_intrvec_offset(uint8 lchip, uint32 intr_type, uint32 * p_offset);
extern int32
sys_at_interrupt_get_sup_info(uint8 lchip, uint32 intr_type, uint32 *p_sup_table_id, uint16 *p_bit_offset, uint32 *p_func_table_id);
extern int32
sys_at_interrupt_db_init(uint8 lchip);

extern int32
sys_tmm_scl_add_compress_ether_type(uint8 lchip, uint16 new_ether_type, uint16 old_ether_type,uint8* o_cether_type, uint8* o_cether_type_index);
extern int32
sys_tmm_scl_remove_compress_ether_type(uint8 lchip, uint8 ether_type_index);
extern int32
sys_tmm_acl_wb_sync(uint8 lchip, uint32 app_id, void * p_wb_data, void * p_user_data);
extern int32
sys_tmm_acl_wb_restore(uint8 lchip, void * p_wb_query);
extern int32
sys_tsingma_nalpm_wb_prefix_restore(uint8 lchip);
extern int32
sys_tsingma_nalpm_wb_prefix_sync(uint8 lchip, uint32 app_id, void * p_wb_data);
extern int32
sys_at_packet_txinfo_to_rawhdr(uint8 lchip, ctc_pkt_tx_t* p_pkt_tx);
extern int32
sys_at_packet_rawhdr_to_rxinfo(uint8 lchip, uint32* p_raw_hdr_net, ctc_pkt_rx_t* p_pkt_rx);
extern int32
sys_at_packet_encap_array(uint8 lchip, ctc_pkt_tx_t** p_pkt_tx_array, uint32 count);
extern int32
sys_at_ipfix_decode_key_ad(uint8 lchip, void* p_data, uint8 is_ad, void* p_key);
extern int32
sys_tmm_ipfix_get_global_cfg(uint8 lchip, void* cfg);
extern int32
sys_tmm_ipfix_set_global_cfg(uint8 lchip, void* cfg);
extern int32
sys_at_serdes_get_link_training_status(uint8 lchip, uint16 serdes_id, uint16* p_value);
extern int32
sys_tmm_serdes_get_property(uint8 lchip, ctc_chip_property_t chip_prop, void* p_value);
extern int32
sys_at_mac_set_link_training_en(uint8 lchip, uint16 serdes_id, uint8 enable);
extern int32
sys_tmm_serdes_set_property(uint8 lchip, ctc_chip_property_t chip_prop, void* p_value);
extern int32
sys_tsingma_mac_link_down_event(uint8 lchip, uint16 lport);
extern int32
sys_tmm_oam_get_mep_info_for_event(uint8 lchip, void* p_mep_info);
extern int32
sys_at_ipfix_init_register(uint8 lchip, void* p_global_cfg);
extern int32
sys_at_ipfix_set_property(uint8 lchip, void* cfg);
extern int32
sys_at_ipfix_get_property(uint8 lchip, void* cfg);
extern int32
sys_at_ipfix_set_flow_cfg(uint8 lchip, void* p_flow_cfg);
extern int32
sys_at_ipfix_get_flow_cfg(uint8 lchip, void* p_flow_cfg);
extern int32
sys_at_ipfix_encode_ad(uint8 lchip, void* key);
extern int32
sys_at_ipfix_decode_ad(uint8 lchip, void* data, void* p_ad);
extern int32
sys_at_ipfix_traverse_dma(uint8 lchip, void* fn, void* p_data, uint8 is_remove);
extern int32
sys_at_ipfix_sync_data(uint8 lchip, void* p_dma_info);
extern int32
sys_at_ipfix_cb_init(uint8 lchip);
extern int32
sys_at_ipfix_set_flex_key(uint8 lchip, void* ipfix_flex_key);
extern int32
sys_at_ipfix_get_flex_key(uint8 lchip, void* ipfix_flex_key);
extern int32
sys_at_ipfix_encode_xkey_hash(uint8 lchip, void* param);
extern int32
sys_at_ipfix_get_flex_key_sets(uint8 lchip, void* ipfix_flex_key);

extern int32
sys_usw_xdata_add_fk(uint8 lchip, void *p_xkey);
extern int32
sys_usw_xdata_remove_fk(uint8 lchip, void* p_para);
extern int32
sys_usw_xdata_set_fk_field(uint8 lchip, void* p_para, uint32* p_ds, uint32 value);
extern int32
sys_usw_xdata_get_fk_field(uint8 lchip, void* p_para, uint32* p_ds, uint32* value);
extern int32
sys_usw_xdata_prof_get_info(uint8 lchip, ctc_xdata_t * p_prof, uint8 with_check);
extern int32
sys_usw_xdata_fk_get_flex_bits(uint8 lchip, void * p_param);
extern int32
sys_usw_xdata_local_get_kset(uint8 lchip, ctc_xdata_local_type_t type, void * kset);
int32
sys_usw_xdata_func_en(uint8 lchip, sys_xdata_func_t type, uint8 enable, void* data);

extern int32
sys_usw_xdata_init(uint8 lchip);
extern int32
sys_usw_xdata_deinit(uint8 lchip);
extern int32
sys_usw_xdata_set_profile(uint8 lchip, ctc_xdata_prof_t* p_prof);
extern int32
sys_usw_xdata_get_profile(uint8 lchip, ctc_xdata_prof_t* p_prof);
extern int32
sys_usw_xdata_set_local(uint8 lchip, ctc_xdata_local_t* p_local);
extern int32
sys_usw_xdata_get_local(uint8 lchip, ctc_xdata_local_t* p_local);
extern int32
sys_usw_xdata_set_path(uint8 lchip, ctc_xdata_path_t* p_path);
extern int32
sys_usw_xdata_get_path(uint8 lchip, ctc_xdata_path_t* p_path);
extern int32
sys_usw_srv6_set_gsid_default_action(uint8 lchip, uint16 lport, uint8 deinit);

extern int32
sys_at_interrupt_dispatch_func(uint8 lchip, uint32* p_status);
extern int32
sys_at_intrrupt_isr_sup_normal(uint8 lchip, uint32 intr, void* p_data);
extern int32
sys_at_interrupt_init_reg(uint8 lchip);

extern int32
sys_at_linkagg_dlb_init(uint8 lchip);
extern int32
sys_at_linkagg_dlb_get_config(uint8 lchip, void* p_cfg);
extern int32
sys_at_linkagg_dlb_set_config(uint8 lchip, void* p_cfg);

extern int32
sys_at_linkagg_update_mirror_dest(uint8 lchip, uint16 tid, uint8 is_set);

extern int32
sys_tmm_linkagg_replace_nonuc_ports(uint8 lchip, void* p_lag_group);

extern int32
sys_at_linkagg_update_nonuc_ports_by_pp(uint8 lchip, void* p_lag_group, uint32 gport, uint32* port_bitmap_old, uint32* port_bitmap_new, uint8 op);

extern int32
sys_at_linkagg_loop_chan_lag_en(uint8 lchip, uint32 enable);

extern int32
_sys_at_aps_set_hw(uint8 lchip, uint16 group_id, void* p_dsaps);
extern int32
_sys_at_aps_get_hw(uint8 lchip, uint16 group_id, void* p_dsaps);
extern int32
_sys_at_aps_set_protections(uint8 lchip, void* p_grp_bitmap);


extern int32 sys_tmm_nh_get_edit_param(uint8 lchip, void* p_nh_db, void* p_para);
extern int32 sys_tmm_nh_ecmp_clear_dlb_flow(uint8 lchip, void* p_nhdb_param);
extern int32 sys_at_nh_mcast_add_dsmet_entry(uint8 lchip, void* mem_param,
                                        uint32 dsnh_offset,
                                        uint8 use_dsnh8w,
                                        void* db_member_list,
                                        void* info_mcast);
extern void
sys_at_nh_dump_mcast_bitmap_info(uint8 lchip, void* p_meminfo, uint8 gchip, uint32* p_memcnt, void* p_dsmet);
extern int32
sys_at_nh_mcast_analyze_member(uint8 lchip, void* p_db_member_list, void* p_member, void** pp_mem_node, bool* p_entry_exit);
extern int32
sys_at_nh_mcast_update_mem(uint8 lchip, void* p_mem_param, void* p_db_member_list, void* p_info_mcast, void* p_member_info, uint8 is_add);

extern int32
sys_at_nh_add_nsh_id(uint8 lchip, uint16 nsh_id, ctc_nh_nsh_param_t* nsh_info, uint32 stats_ptr, uint8 op_type);
extern int32
sys_at_nh_update_nsh_id(uint8 lchip, uint16 nsh_id, ctc_nh_nsh_param_t* nsh_info, uint32 stats_ptr);
extern int32
sys_at_nh_remove_nsh_id(uint8 lchip, uint16 nsh_id);
extern int32
sys_at_nh_get_nsh_edit_info(uint8 lchip, uint16 nsh_id, void* p_edit);
extern int32
sys_at_nh_nsh_init(uint8 lchip, uint8 is_deinit);
extern int32
sys_at_nh_wb_restore(uint8 lchip, ctc_wb_query_t *p_wb_query);
extern int32
sys_at_nh_wb_sync(uint8 lchip, uint32 app_id, ctc_wb_data_t* p_wb_data);
extern int32
sys_tmm_datapath_show_xpipe(uint8 lchip);
/*syncE*/
extern int32 sys_at_sync_ether_set_cfg(uint8 lchip, uint8 sync_ether_clock_id, void* p_sync_ether_cfg);
extern int32 sys_at_sync_ether_get_cfg(uint8 lchip, uint8 sync_ether_clock_id, void* p_sync_ether_cfg);

/*monitor*/
extern int32 sys_tmm_monitor_deinit(uint8 lchip);
extern int32 sys_tmm_monitor_get_global_config(uint8 lchip, void* p_mon_cfg);
extern int32 sys_tmm_monitor_get_path_latency(uint8 lchip, void* p_cfg, uint8 *enable);
extern int32 sys_tmm_monitor_init(uint8 lchip);
extern int32 sys_tmm_monitor_set_global_config(uint8 lchip, void* p_mon_cfg);
extern int32 sys_tmm_monitor_set_path_latency(uint8 lchip, void* p_cfg, uint8 enable);
extern int32 sys_tmm_monitor_show_path(uint8 lchip);
extern int32 sys_at_monitor_clear_path_latency_watermark(uint8 lchip, void* p_mon_watermark, uint16 channel_id);
extern int32 sys_at_monitor_get_path_latency_watermark(uint8 lchip, void* p_mon_watermark, uint16 channel_id);
extern int32 sys_at_monitor_buf_sync_interval(uint8 lchip, uint8 is_set, uint32* interval);
extern int32 sys_at_monitor_buffer_scan(uint8 lchip, uint8 is_set, void* p_cfg);
extern int32 sys_at_monitor_op_buffer_watermark(uint8 lchip, void* p_data, uint8 is_clear);

/*port*/
extern int32 sys_at_port_set_xpipe_en(uint8 lchip, uint32 gport, uint32 value);
extern int32 sys_at_port_set_xpipe_mode(uint8 lchip, uint32 gport, uint32 value);
extern int32 sys_at_port_flow_ctl_init(uint8 lchip);
extern int32 sys_at_port_set_flow_ctl_en(uint8 lchip, void* p_fc_prop, uint8 is_recover);
extern int32 sys_at_port_get_flow_ctl_en(uint8 lchip, void* p_fc_prop);
extern int32 sys_tsingma_port_set_property(uint8 lchip, uint32 gport, ctc_port_property_t port_prop, uint32 value);
extern int32 sys_tsingma_port_get_property(uint8 lchip, uint32 gport, ctc_port_property_t port_prop, uint32* p_value);
extern int32 sys_tsingma_port_init(uint8 lchip);
extern int32 sys_at_port_set_pause_speed(uint8 lchip, uint32 mac_id, void* p_data);

/*dmps_db*/
extern int32 sys_usw_dmps_db_get_port_property(uint8 lchip, sys_dmps_port_info_t* port_info, uint8 port_prop, void *p_value);
extern uint16 sys_usw_dmps_db_get_lport_with_chan(uint8 lchip, uint8 dir_bmp, uint16 chan_id);
extern uint16 sys_usw_dmps_db_get_lport_with_subchan(uint8 lchip, uint8 dir_bmp, uint8 core, uint8 pp, uint8 dp, uint8 sub_chan);
extern uint16 sys_usw_dmps_db_get_lport_with_mac(uint8 lchip, uint16 mac_id);
extern int32 sys_usw_dmps_db_get_sub_chan_by_chan(uint8 lchip, uint8 dir_bmp, uint16 chan, uint16* sub_chan, uint8* pp_id, uint8* dp_id);

/*ptp*/
extern int32 sys_at_ptp_init(uint8 lchip, void* ptp_global_cfg);
extern int32 sys_at_ptp_set_device_type(uint8 lchip, uint8 device_type);
extern int32 sys_at_ptp_adjust_clock_offset(uint8 lchip, void* p_offset);
extern int32 sys_at_ptp_add_device_clock(uint8 lchip, void* clock);
extern int32 sys_at_ptp_remove_device_clock(uint8 lchip, void* p_clock);
extern int32 sys_at_ptp_set_adjust_delay(uint8 lchip, uint32 gport, uint8 type, int64 value);
extern int32 sys_at_ptp_get_clock_timestamp(uint8 lchip, void* timestamp);
extern int32 sys_at_ptp_set_sync_of_tod_input_select(uint8 lchip, uint32 value);
extern int32 sys_at_ptp_set_sync_intf(uint8 lchip, void* p_config);
extern int32 sys_at_ptp_get_sync_intf(uint8 lchip, void* config);
extern int32 sys_at_ptp_add_session(uint8 lchip, void* session_cfg);
extern int32 sys_at_ptp_remove_session(uint8 lchip, void* session_cfg);
extern int32 sys_at_ptp_get_session(uint8 lchip, void* session_cfg);
extern int32 sys_at_ptp_isr_tx_ts_capture(uint8 lchip, uint32 intr, void* p_data);
extern int32 sys_at_ptp_set_clock_drift(uint8 lchip, void* drift);
extern int32 sys_at_ptp_get_clock_drift(uint8 lchip, void* drift);


/*npm*/
extern int32 sys_at_npm_get_stats_from_asic(uint8 lchip, void* p_session);
extern int32 sys_at_npm_isr_sync_stats(uint8 lchip, uint32 intr, void* p_data);

extern int32 sys_at_aging_set_register(uint8 lchip);
extern int32 sys_tmm_aging_get_aging_ptr(uint8 lchip, uint8 domain_type, uint32 key_index, uint32* aging_ptr);
extern int32 sys_tmm_aging_init(uint8 lchip);

extern int32
sys_at_register_get_glb_acl_table(uint8 lchip, uint8 dir, void* p_glb_acl_lkup);
extern int32 sys_at_qos_api_cb_register(uint8 lchip, void** api_cb);

extern int32
sys_at_shape_get_que_shape_profile(uint8 lchip, uint16 queue_id, uint16 queue_offset, void* p_shape);
extern int32
sys_at_shape_get_port_shape_profile(uint8 lchip, uint16 channel, uint32* rate, uint32* thrd,
                                                              uint8* pps_en, uint8* p_shp_en);
extern int32
sys_at_sch_get_queue_sched(uint8 lchip, uint16 queue_id, uint8 queue_offset, uint8* exceed_class, uint16* exceed_weight);

extern int32
sys_at_qos_fcdl_recover(uint8 lchip, uint32 gport, uint8 pri_class, uint8 enable);
extern int32
sys_at_qos_fcdl_detect_mac(uint8 lchip, void* p_fcdl, uint8 is_get);
extern int32
sys_at_queue_drop_read_asic(uint8 lchip, uint8 wred_mode, void* p_queue_node, void* p_sys_profile, uint8* hw_valid);
extern int32
sys_at_queue_get_queue_base(uint8 lchip, uint8 channel, uint16 queue_offset, uint16* queue_base);
extern int32
sys_at_dot1ae_add_sc_to_asic(uint8 lchip, void* sys_chan);
extern int32
sys_at_dot1ae_add_sa_to_asic(uint8 lchip, void* sys_chan, uint8 sa_idx, uint32 update_flag);
extern int32
sys_at_dot1ae_build_sc_index(uint8 lchip, void* sys_chan);
extern int32
sys_at_dot1ae_reset_sec_chan_cfg(uint8 lchip, void* sc_info);
extern int32
sys_at_dot1ae_update_sec_chan(uint8 lchip, void* sys_chan, void* sc);
extern int32
sys_at_dot1ae_en_sec_chan(uint8 lchip, void* bind_sc);
extern int32
sys_at_dot1ae_get_en_sec_chan(uint8 lchip, void* bind_sc);
extern int32
sys_at_dot1ae_unbind_sec_chan(uint8 lchip, void* bind_sc);
extern int32
sys_at_dot1ae_set_glb_cfg(uint8 lchip, void* glb_cfg);
extern int32
sys_at_dot1ae_get_glb_cfg(uint8 lchip, void* glb_cfg);
extern int32
sys_at_dot1ae_get_stats(uint8 lchip, uint32 chan_id, void* stats);
extern int32
sys_at_dot1ae_sync_dma_stats(uint8 lchip, void* p_data);
extern int32
sys_at_dot1ae_register_init(uint8 lchip);
extern int32
sys_at_dot1ae_add_entry(uint8 lchip, void* p_ctc_entry);
extern int32
sys_at_dot1ae_remove_entry(uint8 lchip, uint32 entry_id);
extern int32
sys_at_dot1ae_show_entry(uint8 lchip, void* param);
extern int32
sys_at_dot1ae_chk_pp_id(uint8 lchip, uint32 chan_id);
extern int32
sys_at_dot1ae_set_hash_field_sel(uint8 lchip,    void* hash_sel);
extern int32
sys_at_dot1ae_get_hash_field_sel(uint8 lchip,      void* hash_sel);
extern int32
sys_at_dot1ae_set_chan_ctl(uint8, void* sys_chan);
extern int32
sys_at_dot1ae_chan_wb_restore(uint8 lchip, void* p_chan);
extern int32
sys_at_dot1ae_entry_hash_init(uint8 lchip);
extern int32
sys_at_dot1ae_entry_hash_deinit(uint8 lchip);

/*dma*/
extern int32
sys_at_dma_tcam_scan_reg_init(uint8 lchip, void* p_chan_info, void* p_sys_desc_pad, void* p_sys_desc_info);
extern int32
sys_at_dma_tcam_scan_func(uint8 lchip, uint16 chan);
extern int32
sys_tmm_dma_set_tcam_scan_mode(uint8 lchip, uint8 mode, uint32 timer);
extern int32
sys_tsingma_dma_sync_pkt_rx_stats(uint8 lchip);
extern int32
sys_tsingma_dma_sync_pkt_tx_stats(uint8 lchip);
extern int32
sys_at_dma_pkt_tx(uint8 lchip, ctc_pkt_tx_t* p_pkt_tx);
extern int32
sys_at_dma_pkt_rx(uint8 lchip, uint8 chan_id, void* p_thread_info);
extern int32
sys_at_dma_set_pkt_timer(uint8 lchip, uint32 timer, uint8 enable);
extern int32
sys_at_dma_set_session_pkt(uint8 lchip, uint16 session_id, ctc_pkt_tx_t* p_pkt);
extern int32
sys_tmm_dma_function_pause(uint8 lchip, uint8 chan_id, uint8 en);
extern int32
sys_at_dma_sync_hash_dump(uint8 lchip, void* p_pa, uint16* p_entry_num, void* p_data);
extern int32
sys_at_dma_set_packet_timer_cfg(uint8 lchip, uint16 max_session, uint16 interval, uint16 pkt_len, uint8 is_destroy);
extern int32
sys_at_dma_init_reg_buffer_scan(uint8 lchip, void* p_tmp_chan_info);
extern int32
sys_at_dma_batch_operation(uint8 lchip, void* p_batch);
extern int32
sys_at_dma_info_func(uint8 lchip, uint8 chan);
extern int32
sys_at_dma_stats_func(uint8 lchip, uint8 chan);
extern int32
sys_at_dma_pkt_tx_array(uint8 lchip, ctc_pkt_tx_t** p_pkt_tx_array, uint32 count);
extern int32
sys_at_dma_read_table(uint8 lchip, void* tbl_cfg);
extern int32
sys_at_dma_write_table(uint8 lchip, void* tbl_cfg);
extern int32
sys_at_dma_reset(uint8 lchip);

/*dmps*/extern int32
sys_at_mac_get_property(uint8 lchip, uint16 lport, ctc_port_property_t port_prop, uint32* p_value);
extern int32
sys_at_mac_get_link_up(uint8 lchip, uint16 lport, uint32* p_is_up, uint32 is_phy_link);
extern int32
sys_at_mac_get_capability(uint8 lchip, uint16 lport, ctc_port_capability_type_t type, void* p_value);
extern int32
sys_at_mac_set_capability(uint8 lchip, uint16 lport, ctc_port_capability_type_t type, uint32 value);
extern int32
sys_at_serdes_set_property(uint8 lchip, ctc_chip_property_t chip_prop, void* p_value);
extern int32
sys_at_serdes_get_property(uint8 lchip, ctc_chip_property_t chip_prop, void* p_value);
extern int32
sys_at_mac_init(uint8 lchip);
extern int32
sys_at_mac_self_checking(uint8 lchip, uint16 lport);
extern int32
sys_at_mac_link_up_event(uint8 lchip, uint16 lport);
extern int32
sys_at_mac_link_down_event(uint8 lchip, uint16 lport);
extern int32
sys_at_mac_set_direction_property(uint8 lchip, uint16 lport,
    ctc_port_direction_property_t port_prop, ctc_direction_t dir, uint32 value);
extern int32
sys_at_mac_get_direction_property(uint8 lchip, uint16 lport,
    ctc_port_direction_property_t port_prop, ctc_direction_t dir, uint32* p_value);
extern int32
sys_at_mac_set_link_info(uint8 lchip, uint16 lport, void* p_value);
extern int32
sys_at_mac_get_link_info(uint8 lchip, uint16 lport, void* p_value);
extern int32
sys_at_datapath_init_db(uint8 lchip, void* p_glb_cfg);
extern int32
sys_at_anlt_sm_get_mcu_id_by_dport(uint8 lchip, uint16 dport, uint8* p_mcu_id);
extern int32
sys_at_anlt_sm_set_fec(uint8 lchip, uint16 dport, uint32 value);
extern int32
sys_at_datapath_check_credit_flush_clear(uint8 lchip, uint32 mac_id, uint32 chan_id);
extern int32
sys_at_mac_set_mac_en(uint8 lchip, uint16 lport, void* p_port_info, uint8 enable, uint8 db_upt_flag);
extern int32
sys_at_mac_set_fec(uint8 lchip, uint16 lport, void* p_port_info, uint8 fec_val);
extern int32
sys_at_mac_set_cl37_mode(uint8 lchip, uint16 lport, uint32 value);
extern int32
sys_at_mac_set_speed(uint8 lchip, uint16 lport, uint8 speed_mode);
extern int32
sys_at_mac_set_xpipe_en(uint8 lchip, uint16 lport, uint32 value, uint8 dir_bmp);
extern int32
sys_at_mac_set_internal_property(uint8 lchip, uint16 lport, ctc_port_property_t port_prop, uint32 value);
extern int32
sys_at_mac_get_internal_property(uint8 lchip, uint16 lport, ctc_port_property_t port_prop, uint32* p_value);
extern int32
sys_at_mac_dynamic_switch_set_config(uint8 lchip, void* p_ds_list, uint32 option_bmp);
extern int32
sys_at_mac_dynamic_switch_get_list(uint8 lchip, uint16 lport, void* p_mode, void* p_ds_list);
extern int32
sys_at_mac_dynamic_switch_serdes_get_list(uint8 lchip, void* p_serdes_info, void* p_ds_list);
extern int32
sys_at_mac_get_sfd_en(uint8 lchip, uint16 lport, uint32 *enable);
extern int32
sys_at_mac_set_sfd_en(uint8 lchip, uint16 lport, uint32 enable);
extern int32
sys_at_mac_set_cl37_en(uint8 lchip, uint16 lport, uint32 enable);
extern int32
sys_at_mac_set_cl73_en(uint8 lchip, uint16 lport, uint32 enable, uint8 restart);
extern int32
sys_at_mac_get_cl37_en(uint8 lchip, uint16 lport, uint32* p_en);
extern int32
sys_at_mac_get_cl37_mode(uint8 lchip, uint16 lport, uint32* p_mode);
extern int32
sys_at_mac_isr_event_dispatch(uint8 lchip, uint32 intr, void* p_data, uint8* p_link_intr, ctc_port_link_status_t* port_link_status);
extern int32
sys_at_cpumac_isr_event_dispatch(uint8 lchip, uint32 intr, void* p_data, uint8* p_link_intr, ctc_port_link_status_t* port_link_status);
extern int32
sys_at_mac_dynamic_switch_set_group_power(uint8 lchip, sys_dmps_ds_list_t* p_list, uint8 dyn_flag);
extern int32
sys_usw_dmps_link_up_event(uint8 lchip, uint16 lort);
extern int32
sys_usw_dmps_link_down_event(uint8 lchip, uint16 lport);
extern int32
sys_at_serdes_serdes_to_psd(uint8 lchip, uint16 serdes_id, uint16* psd);
extern int32
sys_at_serdes_psd_to_serdes(uint8 lchip, uint16 psd, uint16* serdes_id);
extern int32
sys_at_datapath_show_xpipe(uint8 lchip);
extern int32
sys_at_mac_set_err_inject(uint8 lchip, uint16 lport, void* p_value);
extern int32
sys_at_mac_get_err_inject(uint8 lchip, uint16 lport, void* p_value);
extern int32 sys_at_mac_daemon_thread(uint8 lchip, uint16 lport);
extern int32
sys_at_mac_set_cl73_ability_ext(uint8 lchip, uint16 dport, uint32 ctc_ability);
extern int32
sys_at_mcu_show_debug_info(uint8 lchip, uint8 mcu_id);
extern int32
sys_at_datapath_set_other_misc_chan(uint8 lchip, uint16 lport, uint8 port_type, uint8 speed_mode, uint8 dir_bmp);
extern int32
_sys_at_mac_set_port_cl73_ability(uint8 lchip, uint16 dport, void* p_ability);
extern int32
_sys_at_serdes_get_loopback(uint8 lchip, void * p_data);
extern int32
sys_at_serdes_fw_download(uint8 lchip, uint16 serdes_id, uint8 flag);

sys_usw_mchip_1ae_t sys_at_mchip_1ae =
{
#if (FEATURE_MODE == 0)
    sys_at_dot1ae_add_sc_to_asic,
    sys_at_dot1ae_add_sa_to_asic,
    sys_at_dot1ae_build_sc_index,
    NULL,/* free_sc_index */
    sys_at_dot1ae_reset_sec_chan_cfg,
    sys_at_dot1ae_get_en_sec_chan,
    sys_at_dot1ae_en_sec_chan,
    sys_at_dot1ae_update_sec_chan,
    sys_at_dot1ae_unbind_sec_chan,
    sys_at_dot1ae_set_glb_cfg,
    sys_at_dot1ae_get_glb_cfg,
    sys_at_dot1ae_get_stats,
    sys_at_dot1ae_sync_dma_stats,
    sys_at_dot1ae_register_init,
    sys_at_dot1ae_add_entry,
    sys_at_dot1ae_remove_entry,
    sys_at_dot1ae_show_entry,
    sys_at_dot1ae_chk_pp_id,
    sys_at_dot1ae_set_hash_field_sel,
    sys_at_dot1ae_get_hash_field_sel,
    sys_at_dot1ae_set_chan_ctl,
    sys_at_dot1ae_chan_wb_restore,
    sys_at_dot1ae_entry_hash_init,
    sys_at_dot1ae_entry_hash_deinit
 #endif
};

sys_usw_mchip_lag_t sys_at_mchip_lag =
{
   sys_tmm_linkagg_destroy,
   sys_tmm_linkagg_add_nonuc_ports,
   sys_tmm_linkagg_remove_nonuc_ports,
   sys_at_linkagg_dlb_init,
   sys_at_linkagg_dlb_set_config,
   sys_at_linkagg_dlb_get_config,
   sys_tmm_linkagg_set_lsh,
   sys_tmm_linkagg_channel_update_nonuc_ports,
   NULL,    //bind_mirror
   sys_at_linkagg_update_mirror_dest,
   sys_tmm_linkagg_replace_nonuc_ports,
   sys_at_linkagg_update_nonuc_ports_by_pp,
   sys_at_linkagg_loop_chan_lag_en,
};

sys_usw_mchip_dmps_t sys_at_mchip_dmps =
{
    .mac_get_link_up                    = sys_at_mac_get_link_up,
    .mac_get_capability                 = sys_at_mac_get_capability,
    .mac_set_capability                 = sys_at_mac_set_capability,
    .serdes_set_property                = sys_at_serdes_set_property,
    .serdes_get_property                = sys_at_serdes_get_property,
    .serdes_set_link_training_en        = sys_at_mac_set_link_training_en,
    .serdes_get_link_training_status    = sys_at_serdes_get_link_training_status,
    .datapath_init                      = sys_at_datapath_init,
    .mac_init                           = sys_at_mac_init,
    .mcu_show_debug_info                = sys_at_mcu_show_debug_info,
    .mac_self_checking                  = sys_at_mac_self_checking,
    .mac_link_up_event                  = sys_usw_dmps_link_up_event,
    .mac_link_down_event                = sys_usw_dmps_link_down_event,
    .datapath_show_xpipe                = sys_at_datapath_show_xpipe,
    .datapath_get_extport_start_id      = sys_at_datapath_get_extport_start_id,
    .mac_set_direction_property         = sys_at_mac_set_direction_property,
    .mac_get_direction_property         = sys_at_mac_get_direction_property,
    .mac_set_link_info                  = sys_at_mac_set_link_info,
    .mac_get_link_info                  = sys_at_mac_get_link_info,
    .check_datapath_credit_clear        = sys_at_datapath_check_credit_flush_clear,
    .dmps_db_port_init                  = sys_at_datapath_init_db,
    .anlt_sm_set_fec                    = sys_at_anlt_sm_set_fec,
    .anlt_sm_get_mcu_id_by_dport        = sys_at_anlt_sm_get_mcu_id_by_dport,
    .mac_set_mac_en                     = sys_at_mac_set_mac_en,
    .mac_set_fec                        = sys_at_mac_set_fec,
    .mac_set_cl37_mode                  = sys_at_mac_set_cl37_mode,
    .mac_set_speed                      = sys_at_mac_set_speed,
    .mac_set_xpipe_en                   = sys_at_mac_set_xpipe_en,
    .mac_set_internal_property          = sys_at_mac_set_internal_property,
    .mac_get_internal_property          = sys_at_mac_get_internal_property,
    .mac_dynamic_switch_set_config      = sys_at_mac_dynamic_switch_set_config,
    .mac_dynamic_switch_get_list        = sys_at_mac_dynamic_switch_get_list,
    .mac_dynamic_switch_serdes_get_list = sys_at_mac_dynamic_switch_serdes_get_list,
    .mac_get_sfd_en                     = sys_at_mac_get_sfd_en,
    .mac_set_sfd_en                     = sys_at_mac_set_sfd_en,
    .mac_set_cl37_en                    = sys_at_mac_set_cl37_en,
    .mac_set_cl73_en                    = sys_at_mac_set_cl73_en,
    .mac_get_cl37_en                    = sys_at_mac_get_cl37_en,
    .mac_get_cl37_mode                  = sys_at_mac_get_cl37_mode,
    .mac_isr_event_dispatch             = sys_at_mac_isr_event_dispatch,
    .cpumac_isr_event_dispatch          = sys_at_cpumac_isr_event_dispatch,
    .mac_dynamic_switch_set_group_power = sys_at_mac_dynamic_switch_set_group_power,
    .serdes_to_psd                      = sys_at_serdes_serdes_to_psd,
    .psd_to_serdes                      = sys_at_serdes_psd_to_serdes,
    .mcu_get_mac_stats                  = sys_at_mcu_get_mac_stats,
    .mcu_clear_mac_stats                = sys_at_mcu_clear_mac_stats,
    .mac_set_err_inject                 = sys_at_mac_set_err_inject,
    .mac_get_err_inject                 = sys_at_mac_get_err_inject,
    .mac_daemon_thread                  = sys_at_mac_daemon_thread,
    .set_cl73_ability_ext               = sys_at_mac_set_cl73_ability_ext,
    .mcu_get_version                    = sys_at_mcu_get_version,
    .mcu_hw_lock                        = sys_usw_mcu_hw_lock,
    .mcu_hw_unlock                      = sys_usw_mcu_hw_unlock,
    .set_other_misc_chan                = sys_at_datapath_set_other_misc_chan,
    .cpumac_get_lport_info_by_inner_idx = sys_usw_dmps_db_cpumac_get_lport_info_by_inner_idx,
    .mac_set_port_cl73_ability          = _sys_at_mac_set_port_cl73_ability,
    .serdes_get_loopback_en             = _sys_at_serdes_get_loopback,
    .serdes_download_firmware           = sys_at_serdes_fw_download,
};

sys_usw_mchip_ipuc_t sys_at_mchip_ipuc =
{
    sys_tsingma_ipuc_tcam_init,
    sys_tsingma_ipuc_tcam_deinit,
    sys_tsingma_ipuc_tcam_get_blockid,
    sys_tsingma_ipuc_tcam_write_key,
    sys_tsingma_ipuc_tcam_write_ad,
    sys_tsingma_ipuc_tcam_move,
    sys_tsingma_ipuc_tcam_show_key,
    sys_tsingma_ipuc_tcam_show_status,
    sys_tsingma_nalpm_show_sram_usage,
    sys_tsingma_nalpm_init,
    sys_tsingma_nalpm_deinit,
    sys_tsingma_nalpm_add,
    sys_tsingma_nalpm_del,
    sys_tsingma_nalpm_update,
    NULL,/*alpm_arrange_fragment*/
    sys_tsingma_nalpm_show_route_info,
    sys_tsingma_nalpm_show_status,/*alpm_show_status*/
    NULL,/*alpm_mapping_wb_master*/
    sys_tsingma_nalpm_wb_get_info,
    sys_tsingma_nalpm_dump_db,
    NULL,
    sys_tsingma_nalpm_set_fragment_status,
    sys_tsingma_nalpm_get_fragment_status,
    sys_tsingma_nalpm_get_fragment_auto_enable,
    NULL,
    sys_tsingma_nalpm_check_route,
    NULL,
    sys_tsingma_nalpm_wb_prefix_restore,
    sys_tsingma_nalpm_wb_prefix_sync,
    sys_tsingma_ipuc_alloc_tcam_key_index,
    sys_tsingma_ipuc_free_tcam_key_index,
    sys_tsingma_ipuc_tcam_move_cb,
    sys_tmm_ipuc_build_ipda_nexthop,
    sys_at_ipuc_write_ipda,
    sys_tsingma_nalpm_wb_set_tcam_index,
    sys_tsingma_nalpm_wb_set_ad_info,
    /* nalpm */
    sys_nalpm2_init,
    sys_nalpm2_deinit,
    sys_nalpm2_add,
    sys_nalpm2_del,
    sys_nalpm2_update,
    sys_nalpm2_show_sram_usage,
    sys_nalpm2_show_route_info,
    sys_nalpm2_show_status,
    sys_nalpm2_dump_db,
    sys_nalpm2_check_route,
    sys_nalpm2_wb_prefix_sync,
    sys_nalpm2_wb_prefix_restore,
    NULL,
    sys_nalpm2_wb_set_tcam_index,
    sys_nalpm2_wb_set_ad_info
};

sys_usw_mchip_acl_t sys_at_mchip_acl =
{
    sys_tmm_acl_init,
    sys_tmm_acl_deinit,
    sys_tmm_acl_set_flex_key_fields,
    sys_tmm_acl_get_flex_key_fields,
    sys_tmm_acl_create_presel,
    sys_tmm_acl_destroy_presel,
    sys_tmm_acl_add_presel_fields,
    sys_tmm_acl_remove_presel_fields,
    sys_tmm_acl_alloc_tcam_entry,
    sys_tmm_acl_free_tcam_entry,
    sys_tmm_acl_build_key_field,
    sys_tmm_acl_get_key_field,
    sys_tmm_acl_show_key_field,
    sys_at_acl_show_flex_hash_field,
    sys_tmm_acl_add_egs_action_field,
    sys_tmm_acl_get_egs_action_field,
    sys_tmm_acl_set_league_mode_flex,
    sys_tmm_acl_expand_link_block,
    sys_tmm_acl_compress_link_block,
    sys_tmm_acl_get_league_update_flag,
    sys_tmm_acl_add_compress_ether_type,
    sys_tmm_acl_remove_compress_ether_type,
    sys_tmm_acl_add_udf_entry,
    sys_tmm_acl_show_flex_keygen,
    sys_tmm_acl_get_flex_key,
    sys_tmm_acl_wb_sync,
    sys_tmm_acl_wb_restore,
    sys_tmm_acl_set_league_global_config,
    sys_tmm_acl_reorder_entry,
    sys_tmm_acl_show_kset,
    sys_at_acl_add_hash_nsh_sel_field,
    sys_at_acl_add_flex_hash_field,
    sys_tmm_acl_replace_block,
    NULL
};

sys_usw_mchip_scl_t sys_at_mchip_scl =
{
    sys_tmm_scl_build_hash_key_svlan_dscp_port,
    sys_tmm_scl_build_field_action_userid_vlan_edit,
    sys_tmm_scl_build_field_action_userid,
    sys_tmm_scl_build_field_action_userid,
    sys_tmm_scl_get_field_action_userid,
    sys_tmm_scl_get_field_action_userid,
    sys_tmm_scl_update_action,
    sys_tmm_scl_get_userid_default_action,
    sys_tmm_scl_add_compress_ether_type,
    sys_tmm_scl_remove_compress_ether_type,
    sys_tmm_scl_move_dsuserid_to_temp,
    sys_at_scl_set_flex_key,
    sys_at_scl_build_flex_key_field,
    sys_at_scl_get_flex_key,
    sys_at_scl_show_flex_key,
    sys_at_scl_set_xkey_valid,
    sys_at_scl_build_hash_key_nsh,
    sys_at_entry_pp_hash_init,
    sys_at_entry_pp_hash_deinit,
    sys_at_scl_get_flex_key_sets
};

sys_usw_mchip_l3if_t sys_at_mchip_l3if =
{
    sys_tmm_l3if_set_igs_if_rmac,
    sys_tmm_l3if_set_system_router_mac,
    sys_tmm_l3if_db_init,
    sys_tmm_l3if_wb_rtmac_restore,
    sys_tmm_l3if_add_router_mac_entry,
    sys_tmm_l3if_remove_router_mac_entry,
    sys_tmm_l3if_get_router_mac_entry,
    sys_tmm_l3if_show_router_mac_entry,
    sys_tmm_l3if_wb_rtmac_sync,
    sys_tmm_l3if_dump_db,
    sys_tmm_l3if_get_igs_if_rmac
};

sys_usw_mchip_ipfix_t sys_at_mchip_ipfix =
{
#if (FEATURE_MODE == 0)
    sys_at_ipfix_decode_key_ad,
    sys_at_ipfix_encode_ad,
    sys_at_ipfix_set_property,
    sys_at_ipfix_get_property,
    sys_tmm_ipfix_set_global_cfg,
    sys_tmm_ipfix_get_global_cfg,
    sys_at_ipfix_set_flow_cfg,
    sys_at_ipfix_get_flow_cfg,
    sys_at_ipfix_init_register,
    sys_at_ipfix_sync_data,
    sys_at_ipfix_traverse_dma,
    sys_at_ipfix_cb_init,
    sys_at_ipfix_set_flex_key,
    sys_at_ipfix_get_flex_key,
    sys_at_ipfix_get_flex_key_sets,
    sys_at_ipfix_encode_xkey_hash
#endif
};

sys_usw_mchip_aging_t sys_at_mchip_ag =
{
    sys_at_aging_set_register,
    sys_tmm_aging_get_key_index,
    sys_tmm_aging_get_aging_ptr,
    sys_tmm_aging_set_aging_status,
    sys_tmm_aging_get_aging_status,
    sys_tmm_aging_get_aging_timer,
    sys_tmm_aging_init
};

sys_usw_mchip_nh_t sys_at_mchip_nh =
{
    sys_tmm_nh_fp_init,
    sys_tmm_nh_add_fp,
    sys_tmm_nh_remove_fp,
    sys_tmm_nh_update_fp,
    sys_tmm_nh_get_fp_db,
    sys_tmm_nh_get_fp_info,
    NULL,
    sys_tmm_nh_get_edit_param,
    sys_at_nh_mcast_add_dsmet_entry,
    sys_at_nh_dump_mcast_bitmap_info,
    NULL,
    sys_at_nh_mcast_analyze_member,
    sys_at_nh_mcast_update_mem,
    sys_at_nh_add_nsh_id,
    sys_at_nh_update_nsh_id,
    sys_at_nh_remove_nsh_id,
    sys_at_nh_get_nsh_edit_info,
    sys_at_nh_nsh_init,
    sys_at_nh_wb_restore,
    sys_at_nh_wb_sync,
    sys_tmm_nh_ecmp_clear_dlb_flow
};

sys_usw_mchip_misc_t sys_at_mchip_misc =
{
    sys_at_capability_init,
    NULL,
    sys_at_map_drop_reason_sys_to_ctc,
    sys_at_map_discard_type,
    sys_at_register_get_glb_acl_table,
    sys_at_com_entry_hash_init,
    sys_at_com_entry_hash_deinit,
    sys_at_com_lookup_pp_bmp_hash,
    sys_at_com_add_pp_bmp_hash,
    sys_at_com_remove_pp_bmp_hash,
    sys_at_com_remove_pp_bmp_hash_by_entry_id,
    sys_at_get_drop_resson_info
};

sys_usw_mchip_paser_t sys_at_mchip_psr =
{
    sys_tsingma_parser_set_hash_field,
    sys_tsingma_parser_get_hash_field,
    sys_tsingma_parser_hash_init,
    sys_tsingma_parser_set_global_cfg,
    sys_tsingma_parser_get_global_cfg
};


sys_usw_mchip_hash_t sys_at_mchip_hash =
{
    sys_tsingma_hash_set_config,
    sys_tsingma_hash_get_config,
    sys_tsingma_hash_set_offset,
    sys_tsingma_hash_get_offset,
    sys_tsingma_hash_set_hash_control,
    sys_tsingma_hash_get_hash_control,
    sys_at_hash_init,
    sys_at_hash_set_selector_ext,
    sys_at_hash_get_selector_ext,
    sys_at_hash_set_selector_remap,
    sys_at_hash_get_selector_remap,
    _sys_at_hash_set_mask_profile_en,
    sys_at_hash_set_udf_hash_en,
    sys_at_hash_get_udf_hash_en,
    sys_at_hash_set_field,
    sys_at_hash_get_field
};

sys_usw_mchip_qos_t sys_at_mchip_qos =
{
    sys_tmm_qos_policer_alloc_offset,
    sys_tmm_qos_policer_free_offset,
    sys_tmm_qos_policer_add_to_asic,
    sys_tmm_qos_policer_remove_from_asic,
    sys_tmm_qos_policer_copp_add_to_asic,
    sys_tmm_qos_policer_deinit_opf,
    sys_tmm_qos_policer_init_opf,
    sys_tmm_qos_policer_spool_init,
    sys_tmm_qos_policer_spool_deinit,
    sys_tmm_qos_policer_init_reg,
    sys_tmm_qos_policer_copp_init,
    sys_tmm_qos_policer_restore_offset,
    sys_tmm_qos_get_policer_param,
    sys_tmm_qos_policer_free_statsptr,
    NULL, /*qos_shape_add_que_shp_to_asics*/
    NULL, /*qos_shape_add_grp_shp_to_asics*/
    NULL, /*qos_shape_add_grp_node_shp_to_asics*/
    NULL, /*qos_shape_add_chan_shp_to_asic*/
    sys_at_shape_get_que_shape_profile,
    NULL, /*qos_shape_get_grp_shape_profile*/
    NULL, /*qos_shape_get_grp_node_shape_profile*/
    sys_at_shape_get_port_shape_profile,
    NULL, /*qos_shape_set_reason_base_pkt_en*/
    NULL, /*qos_queue_write_hash_key*/
    NULL, /*qos_queue_del_hash_key*/
    NULL, /*qos_queue_get_chan_by_grp_id*/
    NULL, /*qos_queue_get_chan_by_que_id*/
    sys_at_queue_get_queue_base, /*qos_queue_get_queue_base*/
    NULL, /*qos_queue_flush*/
    NULL, /*qos_queue_set_port_drop_en*/
    sys_at_queue_drop_read_asic,
    NULL, /*qos_sch_set_hsched*/
    NULL, /*qos_sch_set_queue_sched*/
    NULL, /*qos_sch_set_group_sched*/
    sys_at_sch_get_queue_sched,
    NULL, /*qos_sch_get_group_sched*/
    NULL, /*qos_sch_create_sched_group*/
    NULL, /*qos_sch_destroy_sched_group*/
    NULL, /*qos_sch_dump_sched_group_child_list*/
    NULL, /*qos_sch_update_fc_group*/
    NULL, /*qos_resrc_set_que_drop*/
    NULL, /*qos_resrc_fc_get_profile*/
    NULL, /*qos_shape_init*/
    NULL, /*qos_sch_init*/
    NULL, /*qos_que_init*/
	NULL, /*qos_fcdl_recover_drop_pkt*/
    sys_at_qos_api_cb_register,
    sys_at_qos_fcdl_recover,
    sys_at_qos_fcdl_detect_mac
};


sys_usw_mchip_security_t sys_at_mchip_security =
{
    sys_tmm_storm_ctl_get_profile_from_hw,
    sys_tmm_storm_ctl_add_hw
};

sys_usw_mchip_diag_t sys_at_mchip_diag =
{
#if (FEATURE_MODE == 0)
    sys_at_diag_get_pkt_trace,
    sys_at_diag_get_drop_info,
    sys_at_diag_set_dbg_pkt,
    sys_at_diag_set_dbg_session,
    sys_at_diag_pkt_trace_clear_rslt,
    _sys_at_diag_bist_sram,
    sys_tsingma_diag_get_lb_hash,
    sys_at_get_discard_type_desc,
    sys_at_diag_get_pos,
    sys_at_map_drop_reason_ctc_to_sys,
    sys_at_diag_get_drop_reason
#endif
};

sys_usw_mchip_mon_t sys_at_mchip_monitor =
{
#if (FEATURE_MODE == 0)
    sys_tmm_monitor_set_path_latency,
    sys_tmm_monitor_get_path_latency,
    sys_at_monitor_get_path_latency_watermark,
    sys_at_monitor_clear_path_latency_watermark,
    sys_tmm_monitor_set_global_config,
    sys_tmm_monitor_get_global_config,
    NULL,
    sys_tmm_monitor_init,
    sys_tmm_monitor_deinit,
    sys_tmm_monitor_show_path,
    sys_at_monitor_buf_sync_interval,
    sys_at_monitor_buffer_scan,
    sys_at_monitor_op_buffer_watermark
#endif
};

sys_usw_mchip_flowstats_t sys_at_mchip_flow_stats =
{
    _sys_at_flow_stats_type_init,
    _sys_tmm_flow_stats_ram_init,
    sys_at_flow_stats_show_status,
    sys_at_flow_stats_ds2count,
    sys_at_flow_stats_sync_fifo_stats,
    sys_at_flow_stats_set_ram_pp_property
};

sys_usw_mchip_macstats_t sys_at_mchip_mac_stats =
{
    _sys_at_mac_stats_get_mac_stats,
    _sys_at_mac_stats_clear_mac_stats,
    _sys_at_mac_stats_sync_throughput
};


sys_usw_mchip_npm_t sys_at_mchip_npm=
{
#if (FEATURE_MODE == 0)
    sys_tmm_npm_set_lite_config,
    sys_tmm_npm_get_lite_stats,
    sys_tmm_npm_sync_dma_stats,
    sys_tmm_npm_process_isr,
    sys_at_npm_get_stats_from_asic,
    sys_at_npm_isr_sync_stats
#endif
};

sys_usw_mchip_mirror_t sys_at_mchip_mirror =
{
    NULL,
    NULL
};

sys_usw_mchip_interrupt_t sys_at_mchip_intr =
{
    sys_at_interrupt_get_sup_info,
    sys_at_interrupt_get_intrvec_offset,
    sys_at_interrupt_db_init,
    sys_at_interrupt_dispatch_func,
    NULL, /*interrupt_dispatch_flexe*/
    sys_at_intrrupt_isr_sup_normal,
    sys_at_interrupt_init_reg,
    sys_at_interrupt_set_sup_op
};

sys_usw_mchip_port_t sys_at_mchip_port =
{
    sys_at_port_flow_ctl_init,
    sys_at_port_set_flow_ctl_en,
    sys_at_port_get_flow_ctl_en,
    sys_at_port_set_pause_speed,
    sys_tsingma_port_set_property,
    sys_tsingma_port_get_property,
    sys_tsingma_port_init,
    NULL,
    NULL,
    NULL,
    NULL,
    sys_at_port_set_xpipe_en,
    sys_at_port_set_xpipe_mode
};

sys_usw_mchip_packet_t sys_at_mchip_packet =
{
    sys_at_packet_txinfo_to_rawhdr,
    sys_at_packet_rawhdr_to_rxinfo,
    sys_at_packet_encap_array
};

sys_usw_mchip_xdata_t sys_at_mchip_xdata =
{
    sys_usw_xdata_add_fk,
    sys_usw_xdata_remove_fk,
    sys_usw_xdata_set_fk_field,
    sys_usw_xdata_get_fk_field,
    sys_usw_xdata_prof_get_info,
    sys_usw_xdata_local_get_kset,
    sys_usw_xdata_fk_get_flex_bits,
    sys_usw_xdata_init,
    sys_usw_xdata_deinit,
    sys_usw_xdata_set_profile,
    sys_usw_xdata_get_profile,
    sys_usw_xdata_set_local,
    sys_usw_xdata_get_local,
    sys_usw_xdata_set_path,
    sys_usw_xdata_get_path,
    sys_usw_xdata_func_en
};
sys_usw_mchip_srv6_t sys_at_mchip_srv6 =
{
#if (FEATURE_MODE == 0)
    sys_usw_srv6_set_gsid_default_action
#endif
};
sys_usw_mchip_oam_t sys_at_mchip_oam =
{
#if (FEATURE_MODE == 0)
    sys_tmm_oam_get_mep_info_for_event
#endif
};

sys_usw_mchip_aps_t sys_at_mchip_aps =
{
#if (FEATURE_MODE == 0)
    _sys_at_aps_set_hw,
    _sys_at_aps_get_hw,
    _sys_at_aps_set_protections
#endif
};

sys_usw_mchip_peri_t sys_at_mchip_peri =
{
    sys_at_peri_init,
    sys_at_peri_mdio_init,
    sys_tsingma_peri_set_phy_scan_cfg,
    sys_tsingma_peri_set_phy_scan_para,
    sys_tsingma_peri_get_phy_scan_para,
    sys_tsingma_peri_read_phy_reg,
    sys_tsingma_peri_write_phy_reg,
    sys_at_peri_set_mdio_clock,
    sys_at_peri_get_mdio_clock,
    sys_tsingma_peri_set_mac_led_mode,
    sys_tsingma_peri_set_mac_led_mapping,
    sys_tsingma_peri_set_mac_led_en,
    sys_tsingma_peri_get_mac_led_en,
    sys_at_peri_set_mac_led_clock,
    sys_at_peri_get_mac_led_clock,
    sys_at_peri_set_gpio_mode,
    sys_at_peri_set_gpio_output,
    sys_at_peri_get_gpio_input,
    sys_tsingma_peri_phy_link_change_isr,
    sys_at_peri_get_chip_sensor,
    sys_at_peri_set_sensor_monitor,
    sys_at_peri_get_sensor_monitor,
    sys_tsingma_peri_set_phy_sample_offset,
    sys_tsingma_peri_get_phy_sample_offset,
    sys_tsingma_peri_set_phy_sample_edge,
    sys_tsingma_peri_get_phy_sample_edge
};

sys_usw_mchip_flexe_t sys_at_mchip_flexe =
{
    NULL
};

sys_usw_mchip_ptp_t sys_at_mchip_ptp =
{
#if  (FEATURE_MODE == 0)
    sys_at_ptp_init,
    sys_at_ptp_adjust_clock_offset,
    sys_at_ptp_set_device_type,
    sys_at_ptp_add_device_clock,
    sys_at_ptp_remove_device_clock,
    sys_at_ptp_set_adjust_delay,
    sys_at_ptp_get_clock_timestamp,
    sys_at_ptp_set_sync_of_tod_input_select,
    sys_at_ptp_set_sync_intf,
    sys_at_ptp_get_sync_intf,
    sys_at_ptp_add_session,
    sys_at_ptp_remove_session,
    sys_at_ptp_get_session,
    sys_at_ptp_isr_tx_ts_capture,
    sys_at_ptp_set_clock_drift,
    sys_at_ptp_get_clock_drift
#endif
};

sys_usw_mchip_dmps_db_t sys_at_mchip_dmps_db =
{
    sys_usw_dmps_db_get_port_property,
    sys_usw_dmps_db_get_lport_with_chan,
    sys_usw_dmps_db_get_lport_with_subchan,
    sys_usw_dmps_db_get_lport_with_mac,
    sys_usw_dmps_db_get_sub_chan_by_chan
};

sys_usw_mchip_sync_ether_t sys_at_mchip_sync_ether =
{
    sys_at_sync_ether_set_cfg,
    sys_at_sync_ether_get_cfg
};

sys_usw_mchip_dma_t sys_at_mchip_dma =
{
    sys_at_dma_tcam_scan_reg_init,
    sys_at_dma_tcam_scan_func,
    sys_tmm_dma_set_tcam_scan_mode,
    sys_tsingma_dma_sync_pkt_rx_stats,
    sys_tsingma_dma_sync_pkt_tx_stats,
    sys_at_dma_pkt_tx,
    sys_at_dma_pkt_rx,
    sys_at_dma_set_pkt_timer,
    sys_at_dma_set_session_pkt,
    sys_tmm_dma_function_pause,
    sys_at_dma_sync_hash_dump,
    sys_at_dma_set_packet_timer_cfg,
    sys_at_dma_init_reg_buffer_scan,
    sys_at_dma_batch_operation,
    sys_at_dma_info_func,
    sys_at_dma_stats_func,
    sys_at_dma_pkt_tx_array,
    sys_at_dma_read_table,
    sys_at_dma_write_table,
    sys_at_dma_reset
};

sys_usw_mchip_fdb_t sys_at_mchip_fdb =
{
    sys_at_l2_decode_dsmac,
    sys_at_l2_encode_dsmac,
    sys_tmm_l2_encode_key
};

sys_usw_mchip_serdes_t sys_at_mchip_serdes = {NULL};

#if defined E_UNIT && (FEATURE_MODE == 0)

extern int32
sys_at_eunit_set_cfg(uint8 lchip, uint8 cfg_type, void* p_cfg);
extern int32
sys_at_eunit_get_cfg(uint8 lchip, uint8 cfg_type, void* p_cfg);
extern int32
sys_at_eunit_isr_handler(uint8 lchip, uint32 intr, void* p_data);
extern int32
sys_at_eunit_reset(uint8 lchip, uint8 unit, ctc_eunit_install_t* p_eunit);
extern int32
sys_at_eunit_get_unit_id(uint8 lchip, uint8 cfg_type, uint8* eunit_id);
extern int32
sys_at_eunit_show_status(uint8 lchip, uint8 level, void* p_params);
extern int32
sys_at_eunit_init_deinit(uint8 lchip, uint8 is_deinit);
extern int32
sys_at_eunit_hw_lock(uint8 lchip, uint8 eunit_id, uint8 lock_id);
extern int32
sys_at_eunit_hw_unlock(uint8 lchip, uint8 eunit_id, uint8 lock_id);
extern int32
sys_at_eunit_get_hw_lock(uint8 lchip, uint8 type, uint8* p_eunit_id, uint8* p_lock_id);
extern int32
sys_at_eunit_show_debug_info(uint8 lchip, uint8 eunit_id);
extern int32
sys_at_eunit_read_data(uint8 lchip, uint8 cfg_type, void* p_data,uint16 lenth);
extern int32
sys_at_eunit_show_dma_stats(uint8 lchip, uint8 eunit_id);
extern int32
sys_at_eunit_clear_dma_stats(uint8 lchip, uint8 eunit_id);
extern int32
sys_at_eunit_get_pclog(uint8 lchip, uint8 eunit_id, uint64* pc_arr, uint8* num);
extern int32
sys_at_eunit_tbl_rw(uint8 lchip, uint8 eunit_id, void* p_data, uint8 op_type);
extern int32
sys_at_eunit_show_dma_status(uint8 lchip, uint8 eunit_id);
extern int32
sys_at_eunit_show_dma_desc(uint8 lchip, uint8 eunit_id, uint8 chan_id, uint32 start_idx, uint32 end_idx);
extern int32
sys_at_eunit_show_mem(uint8 lchip, uint32 addr, uint32 len);
extern int32
sys_at_eunit_set_run_status(uint8 lchip, uint8 eunit_id, uint32 run_status);
extern int32
sys_at_eunit_show_io_log(uint8 lchip, uint8 eunit_id, uint8 clear_en);
extern int32
sys_at_eunit_mcpu_set_config(uint8 lchip, uint8 idx, uint32* value);
extern int32
sys_at_eunit_mcpu_get_config(uint8 lchip, uint8 idx, uint32* value);
extern int32
sys_at_eunit_show_version(uint8 lchip, uint8 eunit_id);

sys_usw_mchip_eunit_t sys_at_mchip_eunit =
{
#if (FEATURE_MODE == 0)
    sys_at_eunit_set_cfg, /*set_cfg*/
    sys_at_eunit_get_cfg, /*get_cfg*/
    sys_at_eunit_isr_handler, /*isr_handler*/
    sys_at_eunit_reset,
    sys_at_eunit_get_unit_id, /*get_unit_id*/
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    sys_at_eunit_show_status,
    sys_at_eunit_init_deinit,
    sys_at_eunit_hw_lock,
    sys_at_eunit_hw_unlock,
    sys_at_eunit_get_hw_lock,
    sys_at_eunit_show_debug_info,
    sys_at_eunit_read_data,
    sys_at_eunit_show_dma_stats,
    sys_at_eunit_clear_dma_stats,
    sys_at_eunit_get_pclog,
    sys_at_eunit_tbl_rw,
    sys_at_eunit_show_dma_status,
    sys_at_eunit_show_dma_desc,
    sys_at_eunit_show_mem,
    sys_at_eunit_show_io_log,
    sys_at_eunit_mcpu_set_config,
    sys_at_eunit_mcpu_get_config,
    sys_at_eunit_set_run_status,
    sys_at_eunit_show_version
#endif
};
#endif

int32
sys_at_mchip_init(uint8 lchip)
{

    p_sys_mchip_master[lchip]->p_capability = (uint32*)mem_malloc(MEM_SYSTEM_MODULE, sizeof(uint32)*SYS_CAP_MAX);
    if (NULL == p_sys_mchip_master[lchip]->p_capability)
    {
        return CTC_E_NO_MEMORY;
    }
    sal_memset(p_sys_mchip_master[lchip]->p_capability, 0, sizeof(uint32)*SYS_CAP_MAX);

    p_sys_mchip_master[lchip]->p_mchip_api = (sys_usw_mchip_api_t *)mem_malloc(MEM_SYSTEM_MODULE, sizeof(sys_usw_mchip_api_t));
    if (NULL == p_sys_mchip_master[lchip]->p_mchip_api)
    {
        return CTC_E_NO_MEMORY;
    }
    sal_memset(p_sys_mchip_master[lchip]->p_mchip_api, 0, sizeof(sys_usw_mchip_api_t));
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_1ae = &sys_at_mchip_1ae;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_lag = &sys_at_mchip_lag;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_dmps = &sys_at_mchip_dmps;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_ipuc = &sys_at_mchip_ipuc;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_acl = &sys_at_mchip_acl;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_scl = &sys_at_mchip_scl;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_l3if = &sys_at_mchip_l3if;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_aging = &sys_at_mchip_ag;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_nh = &sys_at_mchip_nh;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_misc = &sys_at_mchip_misc;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_paser = &sys_at_mchip_psr;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_hash = &sys_at_mchip_hash;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_qos = &sys_at_mchip_qos;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_security = &sys_at_mchip_security;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_diag = &sys_at_mchip_diag;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_monitor = &sys_at_mchip_monitor;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_ipfix = &sys_at_mchip_ipfix;
    p_sys_mchip_master[lchip]->p_mchip_api->p_flow_stats = &sys_at_mchip_flow_stats;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mac_stats = &sys_at_mchip_mac_stats;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_npm= &sys_at_mchip_npm;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_mirror= &sys_at_mchip_mirror;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_intr = &sys_at_mchip_intr;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_port = &sys_at_mchip_port;
#if defined E_UNIT && (FEATURE_MODE == 0)
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_eunit = &sys_at_mchip_eunit;
#endif
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_packet = &sys_at_mchip_packet;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_xdata = &sys_at_mchip_xdata;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_oam = &sys_at_mchip_oam;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_aps = &sys_at_mchip_aps;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_flexe = &sys_at_mchip_flexe;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_srv6 = &sys_at_mchip_srv6;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_peri = &sys_at_mchip_peri;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_ptp = &sys_at_mchip_ptp;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_dmps_db = &sys_at_mchip_dmps_db;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_sync_ether = &sys_at_mchip_sync_ether;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_dma = &sys_at_mchip_dma;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_fdb = &sys_at_mchip_fdb;
    p_sys_mchip_master[lchip]->p_mchip_api->p_mchip_serdes = &sys_at_mchip_serdes;
    sal_memset(p_sys_mchip_master[lchip]->feature,0x01,CTC_FEATURE_MAX*sizeof(uint8));
    p_sys_mchip_master[lchip]->feature[CTC_FEATURE_WLAN] = 0;
    p_sys_mchip_master[lchip]->feature[CTC_FEATURE_SC_OAM] = 0;
    p_sys_mchip_master[lchip]->feature[CTC_FEATURE_APP_VLAN_PORT] = 0;
    p_sys_mchip_master[lchip]->feature[CTC_FEATURE_FLEXE] = 0;

    p_sys_mchip_master[lchip]->sub_feature[SYS_FEATURE_HMAC] = 0;
    return CTC_E_NONE;
}

int32
sys_at_mchip_deinit(uint8 lchip)
{
    CTC_PTR_VALID_CHECK(p_sys_mchip_master[lchip]);

    if (p_sys_mchip_master[lchip]->p_capability)
    {
        mem_free(p_sys_mchip_master[lchip]->p_capability);
    }
    if (p_sys_mchip_master[lchip]->p_mchip_api)
    {
        mem_free(p_sys_mchip_master[lchip]->p_mchip_api);
    }
    return CTC_E_NONE;
}
#endif

